#include <stdio.h>
int sum_array(int a[], int n) 
{
    int sum = 0;
    int *p = a;
    for (; p < a + n; p++)
	{
        sum += *p;
    }
    return sum;
}
int main() 
{
    int a[5] = {1,2,3,4,5};
    printf("%d\n", sum_array(a, 5));
    return 0;
}